﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLuaBase.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace XLua.CSObjectWrap
{
    using Utils = XLua.Utils;
    public class YoozooUIYGUIYModuleContainerWrap 
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			System.Type type = typeof(Yoozoo.UI.YGUI.YModuleContainer);
			Utils.BeginObjectRegister(type, L, translator, 0, 2, 4, 4);
			
			
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "onPrefabLoaded", _e_onPrefabLoaded);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "onPrefabDestory", _e_onPrefabDestory);
			
			Utils.RegisterFunc(L, Utils.GETTER_IDX, "OnBindLua", _g_get_OnBindLua);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "prefabName", _g_get_prefabName);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "ModuleName", _g_get_ModuleName);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "ForceReplaceBindLua", _g_get_ForceReplaceBindLua);
            
			Utils.RegisterFunc(L, Utils.SETTER_IDX, "OnBindLua", _s_set_OnBindLua);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "prefabName", _s_set_prefabName);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "ModuleName", _s_set_ModuleName);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "ForceReplaceBindLua", _s_set_ForceReplaceBindLua);
            
			
			Utils.EndObjectRegister(type, L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
			
			
            
			
			
			
            Utils.RegisterFunc(L, Utils.CLS_IDX, "New", __CreateInstanceNew);
			Utils.EndClassRegister(type, L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 1)
				{
					
					var gen_ret = new Yoozoo.UI.YGUI.YModuleContainer();
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
			}
            return LuaAPI.luaL_error(L, "invalid arguments to Yoozoo.UI.YGUI.YModuleContainer constructor!");
            
        }

        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstanceNew(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 0)
				{
					
					var gen_ret = new Yoozoo.UI.YGUI.YModuleContainer();
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
			}
            return LuaAPI.luaL_error(L, "invalid arguments to Yoozoo.UI.YGUI.YModuleContainer constructor!");
            
        }

        
		
        
		
        
        
        
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_OnBindLua(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                Yoozoo.UI.YGUI.YModuleContainer gen_to_be_invoked = (Yoozoo.UI.YGUI.YModuleContainer)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.OnBindLua);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_prefabName(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                Yoozoo.UI.YGUI.YModuleContainer gen_to_be_invoked = (Yoozoo.UI.YGUI.YModuleContainer)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushstring(L, gen_to_be_invoked.prefabName);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_ModuleName(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                Yoozoo.UI.YGUI.YModuleContainer gen_to_be_invoked = (Yoozoo.UI.YGUI.YModuleContainer)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushstring(L, gen_to_be_invoked.ModuleName);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_ForceReplaceBindLua(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                Yoozoo.UI.YGUI.YModuleContainer gen_to_be_invoked = (Yoozoo.UI.YGUI.YModuleContainer)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushstring(L, gen_to_be_invoked.ForceReplaceBindLua);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_OnBindLua(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                Yoozoo.UI.YGUI.YModuleContainer gen_to_be_invoked = (Yoozoo.UI.YGUI.YModuleContainer)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.OnBindLua = (Yoozoo.UI.YGUI.YModuleContainer.BindLuaEvent)translator.GetObject(L, 2, typeof(Yoozoo.UI.YGUI.YModuleContainer.BindLuaEvent));
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_prefabName(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                Yoozoo.UI.YGUI.YModuleContainer gen_to_be_invoked = (Yoozoo.UI.YGUI.YModuleContainer)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.prefabName = LuaAPI.lua_tostring(L, 2);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_ModuleName(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                Yoozoo.UI.YGUI.YModuleContainer gen_to_be_invoked = (Yoozoo.UI.YGUI.YModuleContainer)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.ModuleName = LuaAPI.lua_tostring(L, 2);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_ForceReplaceBindLua(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                Yoozoo.UI.YGUI.YModuleContainer gen_to_be_invoked = (Yoozoo.UI.YGUI.YModuleContainer)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.ForceReplaceBindLua = LuaAPI.lua_tostring(L, 2);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
		
		
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _e_onPrefabLoaded(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			    int gen_param_count = LuaAPI.lua_gettop(L);
			Yoozoo.UI.YGUI.YModuleContainer gen_to_be_invoked = (Yoozoo.UI.YGUI.YModuleContainer)translator.FastGetCSObj(L, 1);
                System.Action<UnityEngine.GameObject> gen_delegate = translator.GetDelegate<System.Action<UnityEngine.GameObject>>(L, 3);
                if (gen_delegate == null) {
                    return LuaAPI.luaL_error(L, "#3 need System.Action<UnityEngine.GameObject>!");
                }
				
				if (gen_param_count == 3)
				{
					
					if (LuaAPI.xlua_is_eq_str(L, 2, "+")) {
						gen_to_be_invoked.onPrefabLoaded += gen_delegate;
						return 0;
					} 
					
					
					if (LuaAPI.xlua_is_eq_str(L, 2, "-")) {
						gen_to_be_invoked.onPrefabLoaded -= gen_delegate;
						return 0;
					} 
					
				}
			} catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
			LuaAPI.luaL_error(L, "invalid arguments to Yoozoo.UI.YGUI.YModuleContainer.onPrefabLoaded!");
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _e_onPrefabDestory(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			    int gen_param_count = LuaAPI.lua_gettop(L);
			Yoozoo.UI.YGUI.YModuleContainer gen_to_be_invoked = (Yoozoo.UI.YGUI.YModuleContainer)translator.FastGetCSObj(L, 1);
                System.Action<UnityEngine.GameObject> gen_delegate = translator.GetDelegate<System.Action<UnityEngine.GameObject>>(L, 3);
                if (gen_delegate == null) {
                    return LuaAPI.luaL_error(L, "#3 need System.Action<UnityEngine.GameObject>!");
                }
				
				if (gen_param_count == 3)
				{
					
					if (LuaAPI.xlua_is_eq_str(L, 2, "+")) {
						gen_to_be_invoked.onPrefabDestory += gen_delegate;
						return 0;
					} 
					
					
					if (LuaAPI.xlua_is_eq_str(L, 2, "-")) {
						gen_to_be_invoked.onPrefabDestory -= gen_delegate;
						return 0;
					} 
					
				}
			} catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
			LuaAPI.luaL_error(L, "invalid arguments to Yoozoo.UI.YGUI.YModuleContainer.onPrefabDestory!");
            return 0;
        }
        
		
		
    }
}
